#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    vector<int> FindNumbersWithSum(vector<int> array, int sum) {
        vector<int>v;
        int left = 0, right = array.size() - 1;
        while (left < right)
        {
            if (array[left] + array[right] > sum)
            {
                right--;
            }
            else if (array[left] + array[right] < sum)
            {
                left++;
            }
            else {
                v.push_back(array[left]);
                v.push_back(array[right]);
                return v;
            }

        }
        return v;
    }
};